import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/table';
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '时间',
    dataIndex: 'createTime',
    width: 150,
    align: 'center',
  },
  {
    title: '手机号',
    dataIndex: 'quMaUserMobile',
    width: 100,
    align: 'center',
  },
  {
    title: '姓名',
    dataIndex: 'quMaUserName',
    width: 100,
    align: 'center',
  },
  {
    title: '商品名称',
    dataIndex: 'goodsName',
    width: 220,
    align: 'center',
  },
  {
    title: '数量',
    dataIndex: 'goodsNum',
    width: 80,
    align: 'center',
  },
  {
    title: '来源',
    dataIndex: 'sourceType',
    width: 120,
    dictData: [
      { label: '扫码注册', value: 1 },
      { label: '商城购买', value: 2 },
      { label: '销售新增', value: 3 },
      { label: '后台新增', value: 4 },
      { label: '后台导入', value: 5 },
      { label: '礼品卡接收', value: 6 },
      { label: '后台批量生成', value: 7 },
      { label: '销售赠送', value: 8 },
      { label: '代理商下单', value: 9 },
      { label: '企业下单', value: 10 },
      { label: '后台券码生成', value: 11 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '金额',
    dataIndex: 'payAmount',
    width: 100,
    align: 'center',
  },
  {
    title: '收款方式',
    dataIndex: 'paywayName',
    width: 150,
    align: 'center',
  },
  {
    title: '使用状态',
    dataIndex: 'useState',
    width: 100,
    align: 'center',
    dictData: [
      { label: '未使用', value: 1 },
      { label: '已使用', value: 2 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '使用时间',
    dataIndex: 'checkDate',
    width: 120,
    align: 'center',
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: 180,
    align: 'center',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'qrCode',
    label: '券号',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'quMaUserName',
    label: '姓名',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'quMaUserMobile',
    label: '手机号',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'startDate',
    label: '开始日期',
    component: 'DatePicker',
    colProps: { span: 5 },
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
  {
    field: 'endDate',
    label: '结束日期',
    component: 'DatePicker',
    colProps: { span: 5 },
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
];
